class ShareController {
    constructor($rootScope, $scope, $cookieStore, $timeout, $state, ngDialog, dialogService, iRunner){

        var vm = this;

        vm.$rootScope    = $rootScope;
        vm.$cookieStore  = $cookieStore;
        vm.$timeout      = $timeout;
        vm.$state        = $state;
        vm.ngDialog      = ngDialog;
        vm.iRunner       = iRunner;

        console.log("ShareController");


            // var data2 = [
            //     [gd(2012, 1, 1), 7], [gd(2012, 1, 2), 6], [gd(2012, 1, 3), 4], [gd(2012, 1, 4), 8],
            //     [gd(2012, 1, 5), 9], [gd(2012, 1, 6), 7], [gd(2012, 1, 7), 5], [gd(2012, 1, 8), 4],
            //     [gd(2012, 1, 9), 7], [gd(2012, 1, 10), 8], [gd(2012, 1, 11), 9], [gd(2012, 1, 12), 6],
            //     [gd(2012, 1, 13), 4], [gd(2012, 1, 14), 5], [gd(2012, 1, 15), 11], [gd(2012, 1, 16), 8],
            //     [gd(2012, 1, 17), 8], [gd(2012, 1, 18), 11], [gd(2012, 1, 19), 11], [gd(2012, 1, 20), 6],
            //     [gd(2012, 1, 21), 6], [gd(2012, 1, 22), 8], [gd(2012, 1, 23), 11], [gd(2012, 1, 24), 13],
            //     [gd(2012, 1, 25), 7], [gd(2012, 1, 26), 9], [gd(2012, 1, 27), 9], [gd(2012, 1, 28), 8],
            //     [gd(2012, 1, 29), 5], [gd(2012, 1, 30), 8], [gd(2012, 1, 31), 25]
            // ];

            // var data3 = [
            //     [gd(2012, 1, 1), 800], [gd(2012, 1, 2), 500], [gd(2012, 1, 3), 600], [gd(2012, 1, 4), 700],
            //     [gd(2012, 1, 5), 500], [gd(2012, 1, 6), 456], [gd(2012, 1, 7), 800], [gd(2012, 1, 8), 589],
            //     [gd(2012, 1, 9), 467], [gd(2012, 1, 10), 876], [gd(2012, 1, 11), 689], [gd(2012, 1, 12), 700],
            //     [gd(2012, 1, 13), 500], [gd(2012, 1, 14), 600], [gd(2012, 1, 15), 700], [gd(2012, 1, 16), 786],
            //     [gd(2012, 1, 17), 345], [gd(2012, 1, 18), 888], [gd(2012, 1, 19), 888], [gd(2012, 1, 20), 888],
            //     [gd(2012, 1, 21), 987], [gd(2012, 1, 22), 444], [gd(2012, 1, 23), 999], [gd(2012, 1, 24), 567],
            //     [gd(2012, 1, 25), 786], [gd(2012, 1, 26), 666], [gd(2012, 1, 27), 888], [gd(2012, 1, 28), 900],
            //     [gd(2012, 1, 29), 178], [gd(2012, 1, 30), 555], [gd(2012, 1, 31), 993]
            // ];


            // function gd(year, month, day) {
            //     return new Date(year, month - 1, day).getTime();
            // }


            //         var dataset = [
            //             {
            //                 label: "Payments",
            //                 data: data2,
            //                 yaxis: 1,
            //                 color: "#1ab394",
            //                 lines: {
            //                     lineWidth:1,
            //                         show: true,
            //                         fill: true,
            //                     fillColor: {
            //                         colors: [{
            //                             opacity: 0.2
            //                         }, {
            //                             opacity: 0.2
            //                         }]
            //                     }
            //                 },
            //                 splines: {
            //                     show: false,
            //                     tension: 0.6,
            //                     lineWidth: 1,
            //                     fill: 0.1
            //                 },
            //             }
            //         ];

            //         var options = {
            //             xaxis: {
            //                 mode: "time",
            //                 tickSize: [3, "day"],
            //                 tickLength: 0,
            //                 axisLabel: "Date",
            //                 axisLabelUseCanvas: true,
            //                 axisLabelFontSizePixels: 12,
            //                 axisLabelFontFamily: 'Arial',
            //                 axisLabelPadding: 10,
            //                 color: "#d5d5d5"
            //             },
            //             yaxes: [{
            //                 position: "left",
            //                 clolor: "#d5d5d5",
            //                 axisLabelUseCanvas: true,
            //                 axisLabelFontSizePixels: 12,
            //                 axisLabelFontFamily: ' Arial',
            //                 axisLabelPadding: 67
            //             }
            //             ],
            //             legend: {
            //                 noColumns: 1,
            //                 labelBoxBorderColor: "#000000",
            //                 position: "nw"
            //             },
            //             grid: {
            //                 hoverable: false,
            //                 borderWidth: 0
            //             }
            //         };

        // $.plot($("#flot-dashboard-chart"), dataset, options);



        Morris.Area({
            element: 'morris-area-chart',
            data: [{ period: '2010-01-01', iphone: 2666},
                { period: '2010-01-02', iphone: 2666},
                { period: '2010-01-03', iphone: 2666},
                { period: '2010-01-04', iphone: 2666},
                { period: '2010-01-05', iphone: 2666},
                { period: '2010-01-06', iphone: 2666},
                { period: '2010-01-07', iphone: 2666},
                { period: '2010-01-08', iphone: 2666},
                { period: '2010-01-09', iphone: 2666},
                { period: '2010-01-10', iphone: 2666},
                { period: '2010-01-11', iphone: 2666},
                { period: '2010-01-12', iphone: 2666},
                { period: '2010-01-13', iphone: 2666},
                { period: '2010-01-14', iphone: 2666},
                { period: '2010-01-15', iphone: 2666},
                { period: '2010-01-16', iphone: 2666},
                { period: '2010-01-17', iphone: 2666},
                { period: '2010-01-18', iphone: 2666},
                { period: '2010-01-19', iphone: 2666},
                { period: '2010-01-20', iphone: 2666},
                { period: '2010-01-21', iphone: 2666},
                { period: '2010-01-22', iphone: 2666},
                { period: '2010-01-23', iphone: 2666},
                { period: '2010-01-24', iphone: 2666},
                { period: '2010-01-25', iphone: 2666},
                { period: '2010-01-26', iphone: 2666},
                { period: '2010-01-27', iphone: 2666},
                { period: '2010-01-28', iphone: 2666},
                { period: '2010-01-29', iphone: 2666},
                { period: '2010-01-30', iphone: 2666},
                { period: '2010-01-31', iphone: 2666},
                { period: '2010-02-01', iphone: 2666},
                { period: '2010-02-02', iphone: 2666},
                { period: '2010-02-03', iphone: 2666},
                { period: '2010-02-04', iphone: 2666}],
            xkey: 'period',
            ykeys: ['iphone'],
            labels: ['iPhone'],
            pointSize: 2,
            hideHover: 'auto',
            resize: true,
            lineColors: ['#87d6c6'],
            lineWidth:2,
            pointSize:1,
        });


    }

}

ShareController.$inject = ['$rootScope', '$scope', '$cookieStore', '$timeout', '$state', 'ngDialog', 'dialogService', 'iRunner']; 

export default ShareController;